package com.lesson01;

public class Test07 {
    public static void main(String[] args) {
        //获取系统类的加载器
        ClassLoader systemClassLoader = ClassLoader.getSystemClassLoader();
        System.out.println(systemClassLoader);
        //获取其上层：扩展类的加载器
        ClassLoader extensionClassLoader = systemClassLoader.getParent();
        System.out.println(extensionClassLoader);
        //获取其上层：根加载器(c,c++)
        ClassLoader bootstrapClassLoader = extensionClassLoader.getParent();
        System.out.println(bootstrapClassLoader);

        //获取当前类是哪个加载器加载的
        ClassLoader classLoader = Test07.class.getClassLoader();
        System.out.println(classLoader);
        //测试JDK内部类
        ClassLoader classLoader1 = String.class.getClassLoader();
        System.out.println(classLoader1);

        //如何查看加载类的路径
        System.out.println(System.getProperty("java.class.path"));
        /*
        C:\Users\35754\OneDrive\桌面\Code\JavaCode\March31\
        out\production\March31
         */
    }
}
